<template>
  <div>
    <div
      v-if="info"
      class="crumbs"
      style="font-size: 12px; color: #666; margin-bottom: 32px"
    >
      <router-link to="/news">新闻资讯</router-link> > {{ info.title }}
    </div>
    <div v-if="info" v-html="info.content"></div>
  </div>
</template>

<script>
import { getApiBaseArticleInfo } from '@/api'
export default {
  data() {
    return {
      info: null,
    }
  },
  created() {
    const id = this.$route.params.id
    getApiBaseArticleInfo({ id }).then((res) => {
      if (res.code === 200) {
        this.info = res.data
      }
    })
  },
  watch: {
    '$route.params.id'(newValue, oldValue) {
      getApiBaseArticleInfo({ id: newValue }).then((res) => {
        if (res.code === 200) {
          this.info = res.data
        }
      })
    },
  },
}
</script>

<style lang="less" scoped>
.crumbs {
}
</style>